package com.rcloud.server.sealtalk.controller;


import com.rcloud.server.sealtalk.domain.AgreementExplain;
import com.rcloud.server.sealtalk.model.response.APIResult;
import com.rcloud.server.sealtalk.model.response.APIResultWrap;
import com.rcloud.server.sealtalk.service.AgreementExplainService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * APP协议说明相关
 *
 * @author zc
 * @email ${email}
 * @date 2019-11-15 19:01:41
 */
@Api(tags = "获取协议内容")
@RestController
@RequestMapping("/agreementExplain")
public class AgreementExplainController {
    @Autowired
    private AgreementExplainService agreementExplainService;

    @GetMapping(value = "/{explainType}")
    @ApiOperation(value = "根据类型获取协议内容", notes = "根据类型获取协议内容")
    @ApiImplicitParam(name = "explainType", value = "类型 1:注册协议 2:隐私政策更新3:商户认证条款", required = true, dataType = "Integer")
    public APIResult<Object> agreementExplain(@PathVariable("explainType") Integer explainType) {
        AgreementExplain one = agreementExplainService.getOne(AgreementExplain.builder().explainType(explainType).build());
        return APIResultWrap.ok(one);
    }

}
